package org.example.basic.day05;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class Demo04集合 {
    public static void main(String[] args) {
        Collection collection = new ArrayList();
        collection.add("张三");
        collection.add(new Teacher("李四",18));
        Object[] o=collection.toArray();
        Teacher teacher=(Teacher) o[1];
        System.out.println(teacher.toString());
        List list=new ArrayList();
    }
}

@Data
@AllArgsConstructor
class Teacher{
    private String name;
    private int age;
}
